Several assets need to be injected to the HTML, such as:
<ul  className="inline-code-break">
  <li><code>{'<script type="module" src="/assets/some-script.fbdfdef8.js">'}</code></li>
  <li><code>{'<link rel="stylesheet" type="text/css" href="/assets/some-css.d65b3120.css">'}</code></li>
  <li><code>{'<link rel="preload" as="font" crossorigin type="font/ttf" href="/assets/some-font.2bc54814.ttf">'}</code></li>
  <li><code>{'<link rel="modulepreload" as="script" type="text/javascript" href="/assets/some-script.e046d7f2.js">'}</code></li>
  <li><code>{'<script>window.__vite_plugin_ssr__pageContext = {_pageId:"\u002Fpages\u002FinjectAssets"}</script>'}</code> (serialized initial <code>pageContext</code> value)</li>
</ul>

`vite-plugin-ssr` automatically inserts these assets to the HTML returned in the `render()` hook.

```js
// _default.page.server.js
// Environment: Node.js

import { escapeInject, dangerouslySkipEscape } from 'vite-plugin-ssr'

async function render(pageContext) {
  // `pageHtml` generated by React/Vue
  const pageHtml = /*...*/

  // `vite-plugin-ssr` injects the assets to the HTML
  return escapeInject`<!DOCTYPE html>
    <html>
      <head>
        <title>${title}</title>
      </head>
      <body>
        <div id="app">${dangerouslySkipEscape(pageHtml)}</div>
      </body>
    </html>`
}
```

If we want to generate the HTML entirely with React/Vue, we can wrap the whole HTML with `dangerouslySkipEscape()` and `vite-plugin-ssr` will still inject the assets.

```js
import { dangerouslySkipEscape } from 'vite-plugin-ssr'

async function render(pageContext) {
  // `pageHtml` is generated by React/Vue and includes the whole HTML document
  const html = /*...*/

  // `vite-plugin-ssr` injects assets to `html`
  return dangerouslySkipEscape(html)
}
```

Also, `vite-plugin-ssr` has an internal `injectAsset()` function that can be made available for you to use and
if, for some reason, you need `injectAsset()` then reach out on Discord or create a new GitHub issue.
